package com.pubinfo.passbook.common.model.http.baseEntity;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.pubinfo.passbook.common.model.http.GetTime;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class Baseinfo implements Serializable {
  private static final long serialVersionUID = -7773537770145248410L;
  
  private String MSGID;
  private String PMSGID;
  private String SENDTIME;
  private String S_PROVINCE;
  private String S_SYSTEM;
  private String SERVICENAME;
  private String T_PROVINCE;
  private String T_SYSTEM;
  private String RETRY;
  
  @JsonProperty("MSGID")
  public void setMSGID(String MSGID) {
    this.MSGID = MSGID;
  }
  
  @JsonProperty("PMSGID")
  public void setPMSGID(String PMSGID) {
    this.PMSGID = PMSGID;
  }
  
  @JsonProperty("SENDTIME")
  public void setSENDTIME(String SENDTIME) {
    this.SENDTIME = SENDTIME;
  }
  
  @JsonProperty("S_PROVINCE")
  public void setS_PROVINCE(String s_PROVINCE) {
    S_PROVINCE = s_PROVINCE;
  }
  
  @JsonProperty("S_SYSTEM")
  public void setS_SYSTEM(String s_SYSTEM) {
    S_SYSTEM = s_SYSTEM;
  }
  
  @JsonProperty("SERVICENAME")
  public void setSERVICENAME(String SERVICENAME) {
    this.SERVICENAME = SERVICENAME;
  }
  
  @JsonProperty("T_PROVINCE")
  public void setT_PROVINCE(String t_PROVINCE) {
    T_PROVINCE = t_PROVINCE;
  }
  
  @JsonProperty("T_SYSTEM")
  public void setT_SYSTEM(String t_SYSTEM) {
    T_SYSTEM = t_SYSTEM;
  }
  
  @JsonProperty("RETRY")
  public void setRETRY(String RETRY) {
    this.RETRY = RETRY;
  }
  
  @JacksonXmlProperty(localName = "MSGID")
  public String getMSGID() {
    return MSGID;
  }
  
  @JacksonXmlProperty(localName = "PMSGID")
  public String getPMSGID() {
    return PMSGID;
  }
  
  @JacksonXmlProperty(localName = "SENDTIME")
  public String getSENDTIME() {
    return SENDTIME;
  }
  
  @JacksonXmlProperty(localName = "S_PROVINCE")
  public String getS_PROVINCE() {
    return S_PROVINCE;
  }
  
  @JacksonXmlProperty(localName = "S_SYSTEM")
  public String getS_SYSTEM() {
    return S_SYSTEM;
  }
  
  @JacksonXmlProperty(localName = "SERVICENAME")
  public String getSERVICENAME() {
    return SERVICENAME;
  }
  
  @JacksonXmlProperty(localName = "T_PROVINCE")
  public String getT_PROVINCE() {
    return T_PROVINCE;
  }
  
  @JacksonXmlProperty(localName = "T_SYSTEM")
  public String getT_SYSTEM() {
    return T_SYSTEM;
  }
  
  @JacksonXmlProperty(localName = "RETRY")
  public String getRETRY() {
    return RETRY;
  }
  
  public Baseinfo() {
  
  }
  
  public Baseinfo(String MSGID, String SENDTIME, String s_PROVINCE, String s_SYSTEM, String SERVICENAME, String t_PROVINCE, String t_SYSTEM, String RETRY) {
    this.MSGID = MSGID;
    this.SENDTIME = SENDTIME;
    S_PROVINCE = s_PROVINCE;
    S_SYSTEM = s_SYSTEM;
    this.SERVICENAME = SERVICENAME;
    T_PROVINCE = t_PROVINCE;
    T_SYSTEM = t_SYSTEM;
    this.RETRY = RETRY;
  }
  
  public static Baseinfo createBaseinfo(String servicename, Date date) {
    return new Baseinfo(GetTime.getMSGID(servicename, date), GetTime.getSENDTIME(date), "02", "ZJ-GDES", servicename, "02", "CW-CFBZ-ZMEJ", "0");
  }
  
  public static Baseinfo createBaseinfo(String servicename, String systemName, Date date) {
    return new Baseinfo(GetTime.getMSGID(servicename, date), GetTime.getSENDTIME(date), "02", systemName, servicename, "02", "CW-CFBZ-ZMEJ", "0");
  }
}
